package com.zhongyouyun.other.model;

import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;


@ApiModel(value="相应对象", description="相应对象")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Result<T> {
    public static final int state = 0;
    public static final int fail = 1;
    public static final Boolean successState = true;
    @ApiModelProperty(value = "0成功1失败 2 下一步")
    private int status = state;
    @ApiModelProperty(value = "说明")
    private String message = "success";

    @ApiModelProperty(value = "错误状态")
    private int errno=state;

    @ApiModelProperty(value = "数据状态")
    private Boolean success=successState;

    public Boolean getSuccess() {
        if (ObjectUtil.isEmpty(success)){
            return  true;
        }
        return success;
    }



    @ApiModelProperty(value = "返回数据")
    private T data;

}
